package agency.web.app.repository.impl;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import agency.web.app.domain.Trip;
import agency.web.app.repository.TripDao;
import agency.web.app.repository.base.AbstractHibernateDao;

@Repository
public class TripRepository extends AbstractHibernateDao <Trip,Integer> implements TripDao{
	
		public Trip findById(int tripId) {
			Criteria cr = getSession()
					.createCriteria(Trip.class, "trip")
					.add(Restrictions.eq("id", tripId));
			return (Trip) cr.uniqueResult();
		}
	
	}


